#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
const int N = 1e6 + 10;
int a[N], b, c[N];
int sa, sc;
void def(int a[], int b, int c[])
{
    long long t = 0;
    for (int i = sc - 1; i >= 0; i--)
    {
        t = t * 10 + a[i];
        c[i] = t / b;
        t %= b;
    }
    while (sc > 1 && c[sc - 1] == 0)
    {
        sc--;
    }
}
int main()
{
    string s;
    cin >> s >> b;
    sa = s.size();
    sc = sa;
    for (int i = 0; i < sa; i++)
        a[sa - 1 - i] = s[i] - '0';
    def(a, b, c);
    for (int i = sc - 1; i >= 0; i--)
    {
        cout << c[i];
    }
    return 0;
}